<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>设置值班人员</title>
       <script src="https://code.jquery.com/jquery-3.4.1.min.js" crossorigin="anonymous"></script>
        <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
         crossorigin="anonymous"></script>

        <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"
         crossorigin="anonymous">
        <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6"
         crossorigin="anonymous"></script>
        <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
        <link href="https://cdn.jsdelivr.net/npm/summernote@0.8.16/dist/summernote-bs4.min.css" rel="stylesheet">
        <script src="https://cdn.jsdelivr.net/npm/summernote@0.8.16/dist/summernote-bs4.min.js"></script>

        <link href="https://cdn.bootcss.com/mdui/0.4.3/css/mdui.min.css" rel="stylesheet">
        <script src="https://cdn.bootcss.com/mdui/0.4.3/js/mdui.min.js"></script>

        <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.bootcss.com/bootstrap-datetimepicker/4.17.47/css/bootstrap-datetimepicker.min.css" rel="stylesheet">
 

<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdn.bootcss.com/moment.js/2.24.0/moment-with-locales.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script>

    </head>
    <style type="text/css">
        body {
            align-content: center;
        }

        .mylabel {
            padding-top: 30px;
            padding-left: 20px;
            font-size: 20px;
        }

        #BasicInfo {
            border-radius: 15px;
            margin: 0 auto;
            align-content: center;
            width: 800px;
        }

        #ConInfo {
            padding-top: 15px;
            border-radius: 15px;
            margin: 30px auto;
            align-content: center;
            width: 800px;
        }

        #PhotoInfo {
            padding-top: 15px;
            border-radius: 15px;
            margin: 30px auto;
            align-content: center;
            width: 800px;
        }

        .mdui-textfield {
            margin-right: 40px;
            margin-left: 40px;
        }

        .Separate {
            padding-bottom: 30px;
        }

        #addImg {
            margin-left: 15px;
        }

        #submitButton {
            text-align: center;
            margin-bottom: 30px;
        }

        .uploadArea {
            padding: 20px;
        }

        #fuwenben {
            margin-top: 15px;
        }
    </style>
    <body class="mdui-theme-primary-light-blue mdui-theme-accent-blue">

        <h2 class="mdui-text-color-theme">设置值班人员</h2>

        
        <div id="content">
          
            <form id="form" method="post" enctype="multipart/form-data">

                <div id="BasicInfo" class="mdui-shadow-5">

                    <div id="basicInfoLabel" class="mylabel">设置值班人员</div>
                    <div class="mdui-textfield">
                     
                      </div>
                    
  
                
                
                        <label class="mdui-textfield-label">值班时间</label>
                        

            <label>选择值班时间：</label>
            <!--指定 date标记-->
            <div class='input-group date' id='datetimepicker1'>
                <input type='text' class="form-control" id="dutyTimeString" />
                <span class="input-group-addon">
                    <span class="glyphicon glyphicon-calendar"></span>
                </span>
            </div>
        
                    <div class="mdui-textfield">
                        <label class="mdui-textfield-label">值班人员id</label>
                        <input class="mdui-textfield-input required" type="text" id="dutyUserid" name="dutyUserid" required />
                        <div class="mdui-textfield-error">此项不能为空</div>
                    </div>
                    
                    

                    <div class="Separate"></div>

                </div>

                 <div class="Separate"></div>

            </form>

            <div id="submitButton">
                <button id="submit" class="mdui-btn mdui-color-theme-accent mdui-ripple" onclick="infoSubmit()">提交</button>
            </div>


        </div>


    


    </body>
    <script>
        var $$ = mdui.JQ;
        var userid = JSON.parse(sessionStorage.getItem("userid"))
        console.log(userid)
        
        $(function () {
        var picker1 = $('#datetimepicker1').datetimepicker({
        format: 'YYYY-MM-DD',
        locale: moment.locale('zh-cn'),
        //minDate: '2016-7-1'
        });
    
    
});


       /** function add123(){
            $('#BasicInfo').append(addname);
        } */

       // var addname = " <label>选择值班时间：</label><div class='input-group date' id='datetimepicker1'> <input type='text' class='form-control' id='dutyTimeString' /><span class='input-group-addon'><span class='glyphicon glyphicon-calendar'></span> </span></div><div class='mdui-textfield'><label class='mdui-textfield-label'>值班人员id</label> <input class='mdui-textfield-input required' type='text' id='dutyUserid' name='dutyUserid' required /> <div class='mdui-textfield-error'>此项不能为空</div></div> <div class='Separate'></div> <div class='Separate'></div>"

       function infoSubmit(){
             $$.ajax({
              method:'POST',
              url:'https://prehealth.top/pre2.0/insertDuty',
              dataType: "json",
              data:{
                  dutyTimeString:$("#dutyTimeString").val(),
                  dutyUserid:$("#dutyUserid").val()
              },
              success: function(data) {
                    $$("#submit").removeAttr("disabled");
                    mdui.snackbar({
                        message: '提交成功',
                        position: 'right-top'
                    });
                },
                fail: function() {
                    $$("#submit").removeAttr("disabled");
                    mdui.snackbar({
                        message: '提交失败',
                        position: 'right-top'
                    });
                }

        })
       }



    </script>
</html>
